broadway: Don't allow dragging windows above top of window
authorAlexander Larsson <alexl@redhat.com>
Tue, 8 Jan 2013 16:37:58 +0000 (17:37 +0100)
committerAlexander Larsson <alexl@redhat.com>
Tue, 8 Jan 2013 17:05:06 +0000 (18:05 +0100)
This is highly confusing and makes it impossible to get the windows
back.

gdk/broadway/broadway.js

index 8f20cce2139b75486aa733771dee757af3c39403..a53f837bd0e8adcc147759340b087f329731accf 100644 (file)
@@ -838,6 +838,8 @@ function onMouseMove (ev) {
            surface.x += dx;
            surface.y += dy;
            var offset = getFrameOffset(surface);
+           if (surface.y < offset.y)
+               surface.y = offset.y;
            localGrab.frame.style["left"] = (surface.x - offset.x) + "px";
            localGrab.frame.style["top"] = (surface.y - offset.y) + "px";
            sendConfigureNotify(surface);